package org.kazuhiko.rpg.client.net.codec;

import org.apache.mina.core.session.IoSession;
import org.apache.mina.filter.codec.ProtocolCodecFactory;
import org.apache.mina.filter.codec.ProtocolDecoder;
import org.apache.mina.filter.codec.ProtocolEncoder;

public final class RPGCodecFactory implements ProtocolCodecFactory
{
	private final ProtocolDecoder decoder;
	private final ProtocolEncoder encoder;
	
	public RPGCodecFactory()
	{
		encoder = new RPGProtocolEncoder();
		decoder = new RPGProtocolDecoder();
	}
	
	@Override
	public ProtocolDecoder getDecoder( IoSession session ) throws Exception
	{
		return decoder;
	}

	@Override
	public ProtocolEncoder getEncoder( IoSession session ) throws Exception
	{
		return encoder;
	}
	
}
